Fix safety doc in intrinsics::simd#159322
Conversation
|
Some changes occurred to the intrinsics. Make sure the CTFE / Miri interpreter cc @rust-lang/miri, @RalfJung, @oli-obk, @lcnr Some changes occurred to the platform-builtins intrinsics. Make sure the cc @antoyo, @GuillaumeGomez, @bjorn3, @calebzulawski, @programmerjake |
|
r? @JohnTitor rustbot has assigned @JohnTitor. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
|
Is there LLVM documentation confirming the exact requirements here?
|
|
Looking at the diff, I think the old and new wording are equivalent. An "unmasked value" is likely meant to be interpreted as a value in a lane that has not been "masked out", i.e. in an enabled lane. But I agree that the old wording is confusing. So r=me on the change, but CI failed because the doc link is not right. |
|
Reminder, once the PR becomes ready for a review, use |
I found the possible corresponding documentation: llvm-masked-gather-intrinsics and llvm-masked-scatter-intrinsics, in which it emphasizes that |
|
@RalfJung I commit the fixed commit, it should have solved the link problem. Besides, I open a topic in Zulip: Maybe some safety doc need fixs in intrinsics::simd. In this topic I refered another functions: Also, I think |
| /// Unmasked values in `T` must be readable as if by `<ptr>::read` (e.g. aligned to the element | ||
| /// type). | ||
| /// Each pointer in `ptr` whose corresponding value in `mask` is `!0` must be readable as if by | ||
| /// [`crate::ptr::read`] (e.g. aligned to the element type). |
There was a problem hiding this comment.
Now the crate:: will show up in the rendered text, that's not great.
Something like [`ptr::read`][crate::ptr::read] should work.
There was a problem hiding this comment.
You dud not copy what I suggested and did not fix the problem I think.
There was a problem hiding this comment.
Oops, thank you for your remind. I think I do the right thing this time.😭
|
Also note that this is still marked as waiting-for-author. As the bot says, please say |
|
@rustbot ready |
|
@rustbot author |
|
@rustbot ready |
|
Thanks :) |
Fix safety doc in intrinsics::simd The Safety documentation for `simd_gather` and `simd_scatter` incorrectly described unmasked values in `T` as requiring readable or writable memory. The memory access is performed through the corresponding enabled pointer lane in `ptr`, so this updates the documentation to state that requirement explicitly.
…uwer Rollup of 18 pull requests Successful merges: - #150679 (dirfd file operations (2/4)) - #158758 (Rename `lazy_type_alias` feature gate to `checked_type_aliases` ) - #159177 (Explicitly materialize debuginfo tests for all debuggers) - #159392 (Update Rust crate rand to v0.9.3 [SECURITY]) - #159393 (Update Rust crate rkyv to v0.8.16 [SECURITY]) - #159394 (Update Rust crate tar to v0.4.46 [SECURITY]) - #159395 (Update Rust crate tracing-subscriber [SECURITY]) - #159193 (Port compiletest's CLI to clap) - #158992 (Shorten types more when only interesting part is lifetimes) - #159226 (Track extra_lifetime_params_map per-owner) - #159273 (tidy: document u64 limit for numeric sort keys) - #159322 (Fix safety doc in intrinsics::simd) - #159329 (Fix the stale metrics directory warning) - #159357 (Add regression tests for two fixed issues) - #159360 (Remove FIXMEs referencing #44232) - #159375 (make a couple codegen-llvm tests compatible with 2021 edition) - #159381 (emit `(lldb)` prefix to make commands more distinct) - #159396 (Update actions/checkout action to v7)
The Safety documentation for
simd_gatherandsimd_scatterincorrectly described unmasked values inTas requiring readable or writable memory.The memory access is performed through the corresponding enabled pointer lane in
ptr, so this updates the documentation to state that requirement explicitly.